package com.assisjrs.jpaandroid.bootstrap;

import junit.framework.Assert;
import junit.framework.TestCase;

import com.assisjrs.jpaandroid.persistence.EntityManagerFactory;
import com.assisjrs.jpaandroid.persistence.Persistence;

public class TestBooststrapPersistence extends TestCase {
	public void _testIncializarEntityManagerFactory() {

		final EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory(null, "jpa-android-test");

		assert entityManagerFactory != null : "Ao chamar o Persistence.createEntityManagerFactory deve retornar o emf.";
	}

	public void testAoCriarOEntityManagerFactoryOContextEObrigatorio() {
		try {
			Persistence.createEntityManagerFactory(null, "jpa-android-test");
			Assert.fail();
		} catch (final Exception e) {
			assert true;//Tem que passar por aqui.
		}
	}
}
